#include "seg.h"

unsigned char code segduan[17]={0xc0,0xf9,0xa4,0xb0,0x99,0x92,0x82,0xf8,0x80,0x90,0x88,0x83,0xc6,0xa1,0x86,0x8e};



void delay(unsigned int i)
{
	while(i--);	
}


void segdisplay(unsigned char *a){
	unsigned char i;
	unsigned char j=0;
	unsigned int count;
	for(i=0;i<strlen(a);i++){
		for(count=0;count<100;count++){
			for(j=0;j<8;j++){
				LS=~(0xFF&(0x80 >> j));
				SEG=segduan[a[(i+j)%(strlen(a))]-48]; 
				delay(100);	
				SEG=0xFF;
			}
		}
	}
}

